<template>
	<Page :config='pageConfig'>
		
	</Page>
</template>

<script setup>
	const Page			= $.lazy(()=>import('#tp/content/page-content.vue'))
	/* ---------------------------  提交表单 --------------------------- */
	const formModalConfig = {
		// title 		: '弹窗表单',
		width 	: '40%',
		labelWidth 	: 's5',
		api 		: '/submitApi', 					// 提交接口
		// infoApi 	: '/infoApi', 						// 回显接口
		data:[
			{ label:'Vue',  name:'vue' },
			{ label:'React', name:'react' },
		],
		backData: { vue:'123' },
		// controls: {
		// 	okText: '提交',
		// 	after: [{ label:'后置按钮' }],
		// 	before: [{ label:'前置按钮' }]
		// }
	}
	const pageConfig = {
		title: '全局弹窗表单',
		controls	: [
			{ label:'配置弹窗', mode:'formModal', config: formModalConfig },
			{ label:'动态配置', mode:'formModal', config: () => formModalConfig},
			{ label:'动态打开', click:({ label }) => window.$formModalRef().open({title:label, ...formModalConfig}) },
		]
	}
</script>